using System;

namespace System.Windows
{
  // Summary:
  //     Provides data for the System.Windows.Application.UnhandledException event.
  public class ApplicationUnhandledExceptionEventArgs : EventArgs
  {
    private Exception _unhandledException;
    private bool _handled;

    // Summary:
    //     Initializes a new instance of the System.Windows.ApplicationUnhandledExceptionEventArgs
    //     class.
    //
    // Parameters:
    //   ex:
    //     The exception that is being thrown as unhandled.
    //
    //   handled:
    //     A value that indicates whether the exception has been handled and should
    //     not be processed further.
    public ApplicationUnhandledExceptionEventArgs(Exception ex, bool handled)
    {
      _unhandledException = ex;
      _handled = handled;
    }

    // Summary:
    //     Gets or sets the unhandled exception.
    //
    // Returns:
    //     The unhandled exception.
    public Exception ExceptionObject 
    {
      get { return _unhandledException; }
      set { _unhandledException = value; }
    }
    //
    // Summary:
    //     Gets or sets a value that indicates whether the exception is handled.
    //
    // Returns:
    //     true to mark the exception as handled, which indicates that Silverlight should
    //     not process it further; otherwise, false.
    public bool Handled 
    {
      get { return _handled; }
      set { _handled = value; }
    }
  }
}